#
# Makefile for NewLife module: init.ko
#
export CC := i386-elf-g++ -fno-exceptions -g -c
export AS := nasm -f elf
export LD := i386-elf-ld
MAKE := make

## CONFIGURATION
# Directory of include file
#export INC_DIR := ../include
#CC += -I $(INC_DIR)/
#AS += -I $(INC_DIR)/asm-inc/
# Directory of intermedia/object file
export OBJ_DIR := /home/forever043/SVN/build/modules/init
export VPATH := $(OBJ_DIR)

OBJ := $(OBJ_DIR)/main.o $(OBJ_DIR)/start.o $(OBJ_DIR)/video.o 

$(OBJ_DIR)/init.ko : $(OBJ)
	$(LD) -T linker.ld -o $@ $(OBJ) -lc

$(OBJ_DIR)/start.o : start.s
	$(AS) -o $@ start.s

$(OBJ_DIR)/main.o : main.cpp
	$(CC) -o $@ main.cpp

$(OBJ_DIR)/video.o : video.cpp
	$(CC) -o $@ video.cpp

all : $(OBJ_DIR)/init.ko ./Makefile

rebuild : clean all

tar :

install :
	cp $(OBJ_DIR)/init.ko /usr/home/NewLife/boot/ 

clean :
	- rm $(OBJ_DIR)/*.*

.PHONY : all tar clean rebuild install
